﻿<Window x:Class="Newgen.Windows.ToolbarWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Controls="clr-namespace:Newgen.Controls" xmlns:Properties="clr-namespace:Newgen.Properties" x:Name="this" Width="90" AllowsTransparency="True" Background="#00000000" Loaded="WindowLoaded" MouseLeave="ToolbarMouseLeave" MouseLeftButtonUp="WindowMouseLeftButtonUp" PreviewKeyDown="WindowPreviewKeyDown" ResizeMode="NoResize" ShowInTaskbar="False" Topmost="True" WindowStyle="None">
    <Window.ContextMenu>
        <ContextMenu>
            <MenuItem Click="MenuItem_Tiles_Click" Header="{x:Static Properties:Resources.TilesItem}">
                <MenuItem.Icon>
                    <Image Source="/Newgen;component/Resources/tiles_icon.png" Width="16" Height="16" />
                </MenuItem.Icon>
            </MenuItem>
            <Separator />
            <MenuItem Click="MenuItem_Exit_Click" Header="{x:Static Properties:Resources.ExitItem}">
                <MenuItem.Icon>
                    <Image Source="/Newgen;component/Resources/exit_icon.png" Width="16" Height="16" />
                </MenuItem.Icon>
            </MenuItem>
        </ContextMenu>
    </Window.ContextMenu>
    <Window.Resources>
        <Storyboard x:Key="ToolbarOpenAnim" BeginTime="0:0:0.05">
            <DoubleAnimation Storyboard.TargetName="this" Storyboard.TargetProperty="Left" AccelerationRatio="0.7" DecelerationRatio="0.3" Duration="0:0:0.2" />
            <DoubleAnimation Storyboard.TargetName="MainContent" Storyboard.TargetProperty="Opacity" AccelerationRatio="0.5" DecelerationRatio="0.3" Duration="0:0:0.2" To="1" />
        </Storyboard>
        <Storyboard x:Key="ToolbarCloseAnim" BeginTime="0:0:0.3" Completed="ToolbarCloseAnimCompleted">
            <DoubleAnimation Storyboard.TargetName="this" Storyboard.TargetProperty="Left" AccelerationRatio="0.7" DecelerationRatio="0.3" Duration="0:0:0.2" />
            <DoubleAnimation Storyboard.TargetName="MainContent" Storyboard.TargetProperty="Opacity" AccelerationRatio="0.5" DecelerationRatio="0.3" Duration="0:0:0.4" To="0.01" />
        </Storyboard>
    </Window.Resources>
    <Grid Margin="5,0,0,0" Background="#00000000">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Border x:Name="TouchSupportPin" Grid.Column="0" Height="60" Margin="0,0,-5,0" Width="12" Background="Black" CornerRadius="5" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Border.Effect>
                <DropShadowEffect BlurRadius="1.5" ShadowDepth="0" />
            </Border.Effect>
            <Image Stretch="None">
                <Image.Source>
                    <DrawingImage>
                        <DrawingImage.Drawing>
                            <GeometryDrawing Brush="White">
                                <GeometryDrawing.Geometry>
                                    <GeometryGroup>
                                        <EllipseGeometry Center="0,5" RadiusX="1.5" RadiusY="1.5" />
                                        <EllipseGeometry Center="0,15" RadiusX="1.5" RadiusY="1.5" />
                                        <EllipseGeometry Center="0,25" RadiusX="1.5" RadiusY="1.5" />
                                    </GeometryGroup>
                                </GeometryDrawing.Geometry>
                            </GeometryDrawing>
                        </DrawingImage.Drawing>
                    </DrawingImage>
                </Image.Source>
            </Image>
        </Border>
        <Grid x:Name="MainContent" Grid.Column="1" Background="Black">
            <StackPanel Name="Toolbar" VerticalAlignment="Center">
                <Controls:ToolbarItem x:Name="SearchButton" Icon="/Newgen;component/Resources/search_icon.png" MouseLeftButtonUp="SearchButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.SearchItem}" />
                <Controls:ToolbarItem x:Name="ShareButton" Icon="/Newgen;component/Resources/share_icon.png" MouseLeftButtonUp="ShareButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.ShareItem}" />
                <Controls:ToolbarItem x:Name="StartButton" Icon="/Newgen;component/Resources/start_icon.png" MouseLeftButtonDown="StartButtonMouseLeftButtonDown" Title="{x:Static Properties:Resources.StartItem}" />
                <Controls:ToolbarItem x:Name="ConnectButton" Icon="/Newgen;component/Resources/connect_icon.png" MouseLeftButtonDown="ConnectButtonMouseLeftButtonDown" Title="{x:Static Properties:Resources.ConnectItem}" />
                <Controls:ToolbarItem x:Name="SettingsButton" Icon="/Newgen;component/Resources/settings_icon.png" MouseLeftButtonUp="SettingsButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.OptionsItem}" />
            </StackPanel>
            <Grid Background="Black" Name="TilesListGrid" Visibility="Collapsed">
                <Controls:ToolbarItem x:Name="BackButton" Margin="0,50,0,0" Icon="/Resources/back_icon.png" MouseLeftButtonUp="BackButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.BackItem}" VerticalAlignment="Top" />
                <Controls:DragScrollViewer Margin="0,150,0,0" DragEverywhere="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
                    <StackPanel VerticalAlignment="Center">
                        <StackPanel Name="TilesList" VerticalAlignment="Center" Visibility="Collapsed">
                            <Controls:ToolbarItem x:Name="WidgetsButton" Icon="/Newgen;component/Resources/tiles_icon.png" MouseLeftButtonUp="WidgetsButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.WidgetsItem}" />
                            <Controls:ToolbarItem x:Name="PinWebButton" Icon="/Newgen;component/Resources/pinweb_icon.png" MouseLeftButtonUp="PinWebButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.PinWebItem}" />
                            <Controls:ToolbarItem x:Name="PinAppButton" Icon="/Newgen;component/Resources/pin_icon.png" MouseLeftButtonUp="PinAppButtonMouseLeftButtonUp" Title="{x:Static Properties:Resources.PinAppItem}" />
                        </StackPanel>
                        <StackPanel Name="WidgetsList" VerticalAlignment="Center" Visibility="Collapsed" />
                    </StackPanel>
                </Controls:DragScrollViewer>
            </Grid>
        </Grid>
    </Grid>
</Window>